package com.itheima.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.itheima.dto.AreaDTO;
import com.itheima.dto.CityDTO;
import com.itheima.dto.Coord;
import com.itheima.entity.Cities;
import com.itheima.entity.Houses;
import com.itheima.mapper.AreasMapper;
import com.itheima.mapper.CitiesMapper;
import com.itheima.mapper.HousesMapper;
import com.itheima.service.IAreasService;
import org.apache.ibatis.exceptions.TooManyResultsException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;


/**
 * areas 相关service实现类
 *
 * @author WEI
 * @since 2021-8-6 15:38:56
 */
@Service
public class AreasServiceImpl implements IAreasService {
    private static final ObjectMapper JSONMAPPER = new ObjectMapper();
    @Autowired
    private CitiesMapper citiesMapper;
    @Autowired
    private HousesMapper housesMapper;
    @Autowired
    private AreasMapper areasMapper;

    @Override
    public List<AreaDTO> selectMapByAreaId(String areaId) throws IOException {

        //2.为每个AreaDTO注入
        List<AreaDTO> res =citiesMapper.selectListByAreaId(areaId);



        return res;

    }


}